#include"Model.h"
#include"Viewer.h"
#include"Controller.h"
#include<iostream>
int main()
{
	Model *pModel = new Model();
	Controller *pController = new Controller();

	pModel->SetController(pController);
	pModel->SetData("State1");
	
	Viewer *pViewer1 = new Viewer("Viewer1");
	Viewer *pViewer2 = new Viewer("Viewer2");
	Viewer *pViewer3 = new Viewer("Viewer3");

	pModel->Register(pViewer1);
	pModel->Register(pViewer2);
	pModel->Register(pViewer3);

	pModel->Notify();

	cout<<"************************"<<endl;
	pModel->UnRegister(pViewer2);
	pModel->Notify();
	
	delete pViewer3;
	delete pViewer2;
	delete pViewer1;
	delete pController;
	delete pModel;
	
	std::cin.get();
	return 0;
}